from mediator import mediator
from mediator . tests . test_assistant import make_mediator_test_keyword_args

class welcome_gui_fake :
    def __init__ ( self ) :
        self . _show_welcome = False
        self . _hide_welcome = False
        self . _application_window_reply = None
        self . _gui_create_frame_reply = None
        self . _gui_create_label_reply = None
        self . _gui_create_image_reply = None
    def show_welcome ( self ) :
        self . _show_welcome = True
    def hide_welcome ( self ) :
        self . _hide_welcome = True
    def application_window_reply ( self , window ) :
        self . _application_window_reply = window
    def gui_create_frame_reply ( self , frame ) :
        self . _gui_create_frame_reply = frame
    def gui_create_label_reply ( self , label ) :
        self . _gui_create_label_reply = label
    def gui_create_image_reply ( self , image ) :
        self . _gui_create_image_reply = image
    
class arbitrary_module_fake :
    def show_welcome ( self ) :
        pass
    def hide_welcome ( self ) :
        pass
    def application_window_reply ( self , window ) :
        pass
    def gui_create_frame_reply ( self , frame ) :
        pass
    def gui_create_label_reply ( self , label ) :
        pass

class mediator_welcome_gui_tests : 
    'mediator_welcome_gui'
    def __init__ ( self , test ) :
        self . _test = test
        self . _welcome_gui = welcome_gui_fake ( )
        self . _mediator = mediator ( )
        self . _mediator . register_modules ( ** make_mediator_test_keyword_args \
            ( 'welcome_gui' 
            , self . _welcome_gui
            , arbitrary_module_fake
            ) )
    def test_show_welcome ( self ) :
        self . _mediator . show_welcome ( )
        self . _test . assume_true ( self . _welcome_gui . _show_welcome )
    def test_hide_welcome ( self ) :
        self . _mediator . hide_welcome ( )
        self . _test . assume_true ( self . _welcome_gui . _hide_welcome )
    def test_application_window_reply ( self ) :
        self . _mediator . application_window_reply ( 'my window' )
        self . _test . assume_equal ( self . _welcome_gui . _application_window_reply , 'my window' )
    def test_gui_create_frame_reply ( self ) :
        self . _mediator . gui_create_frame_reply ( 'my frame' )
        self . _test . assume_equal ( self . _welcome_gui . _gui_create_frame_reply , 'my frame' )
    def test_gui_create_label_reply ( self ) :
        self . _mediator . gui_create_label_reply ( 'my label' )
        self . _test . assume_equal ( self . _welcome_gui . _gui_create_label_reply , 'my label' )
    def test_gui_create_image_reply ( self ) :
        self . _mediator . gui_create_image_reply ( 'my image' )
        self . _test . assume_equal ( self . _welcome_gui . _gui_create_image_reply , 'my image' )
